﻿	      <?php include("conn.php");
             mysql_query('SET NAMES UTF8'); 

	  

class MyPrizeBean
{
	
	public $images;
	public $title;
	public $addtime;
	public $reply;
	public $content;
	public $like;
	
	function __construct($images,$title,$addtime,$reply,$content,$like)
	{
		
		$this->images      = $images;
		$this->title      = $title;
		$this->addtime      = $addtime;
		$this->reply      = $reply;
		$this->content      = $content;
		$this->like      = $like;
	
	}
}

if($_REQUEST['page']!="")
{
$de=$_REQUEST['page']*$_REQUEST['pagesize'];
$size=$_REQUEST['pagesize'];
}

else
{
$de=0;
$size=5;
}




   $rert31=mysql_query("select *from community  order by id desc limit $de,$size ");
  $prize = array();
 while($rowf=mysql_fetch_array($rert31)){

  
     $rert32=mysql_query("select *from user where userid='".$rowf[userid]."'");
     $rowf3=mysql_fetch_array($rert32);




   
		$prize[] = new MyPrizeBean($rowf3['images'],$rowf3['title'],$rowf['addtime'],$rowf['replymember'],$rowf['content'],$rowf['xihuan']);
		

}
echo json_encode($prize);


?>